package com.dji.custom.controller;

import com.dji.custom.service.LiveCustomService;
import com.dji.sample.manage.model.dto.LiveTypeDTO;
import com.dji.sdk.common.HttpResultResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sean
 * @version 0.2
 * @date 2021/12/7
 */
@Slf4j
@RestController
@RequestMapping("${url.manage.prefix}${url.manage.version}/custom")
public class CustomController {

    @Autowired
    private LiveCustomService liveCustomService;

    @PostMapping("/live/start")
    public HttpResultResponse liveStart(@RequestBody LiveTypeDTO liveParam) {
        return liveCustomService.customLiveStart(liveParam);
    }

    @PostMapping("/live/stop")
    public HttpResultResponse liveStop(@RequestBody LiveTypeDTO liveParam) {
        return liveCustomService.customLiveStop(liveParam.getVideoId());
    }


}
